//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.customer;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.print.PrinterJob;
import java.util.*;
import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.table.*;
import org.jpgolay.gui.iconBar.*;
import org.jpgolay.me.family.FamilyUtility;
import org.jpgolay.me.list.ListPrint;
import org.jpgolay.me.persistence.ObjectCRUD;
import org.jpgolay.me.salesperson.SalesPerson;
import org.jpgolay.me.util.BrowserControl;
import org.jpgolay.me.util.Parameter;

// Referenced classes of package org.jpgolay.me.customer:
//            OLD_CustomerList
public class OLD_CustomerListGUI extends JInternalFrame {

    private class TableModel extends AbstractTableModel {

        public int getColumnCount() {
            return colonnes.size();
        }

        public int getRowCount() {
            return rangees.size() / getColumnCount();
        }

        public String getColumnName(int col) {
            String colName = "";
            if (col <= getColumnCount()) {
                colName = (String) colonnes.elementAt(col);
            }
            return colName;
        }

        public Class getColumnClass(int col) {
            return getValueAt(0, col).getClass();
        }

        public boolean isCellEditable(int row, int col) {
            return false;
        }

        public Object getValueAt(int row, int col) {
            return (String) rangees.elementAt(row * getColumnCount() + col);
        }

        public void setValueAt(Object obj, int i, int j) {
        }

        TableModel() {
        }
    }

    public OLD_CustomerListGUI() {
        initComponents();
        setFrameIcon(new ImageIcon(getClass().getResource("/org/jpgolay/me/images/customerList16x16.png")));
        fillComboBox();
        iconBar1.addAnswerListener(new AnswerListener() {
            public void create(AnswerEvent answerevent) {
            }

            public void open(AnswerEvent e) {
                ouvrir();
            }

            public void modify(AnswerEvent answerevent) {
            }

            public void save(AnswerEvent answerevent) {
            }

            public void remove(AnswerEvent answerevent) {
            }

            public void print(AnswerEvent e) {
                imprimer();
            }

            public void help(AnswerEvent e) {
                aide();
            }
        });
        screen = Toolkit.getDefaultToolkit().getScreenSize();
    }

    private void initComponents() {
        buttonGroup1 = new ButtonGroup();
        iconBar1 = new IconBar();
        mainP = new JPanel();
        FlowLayout flowLayout4 = new FlowLayout();
        selectionP = new JPanel();
        jPanel1 = new JPanel();
        parFamilleJR = new JRadioButton();
        famillesJCB = new JComboBox();
        parCommercialJR = new JRadioButton();
        commerciauxJCB = new JComboBox();
        parJR = new JRadioButton();
        selectJCB = new JComboBox();
        requeteF = new JTextField();
        validerB = new JButton();
        dataP = new JPanel();
        defiler = new JScrollPane();
        voletBas = new JPanel();
        infoLeftL = new JLabel();
        infoCenterL = new JLabel();
        infoRightL = new JLabel();
        jMenuBar1 = new JMenuBar();
        optionsM = new JMenu();
        newMI = new JMenuItem();
        openMI = new JMenuItem();
        saveMI = new JMenuItem();
        modifyMI = new JMenuItem();
        removeMI = new JMenuItem();
        jSeparator1 = new JSeparator();
        printMI = new JMenuItem();
        helpMI = new JMenuItem();
        setTitle("LISTE CLIENTS");
        iconBar1.setEnabledCreate(false);
        iconBar1.setEnabledModify(false);
        iconBar1.setEnabledRemove(false);
        iconBar1.setEnabledSave(false);
        iconBar1.setPreferredSize(new Dimension(191, 29));
        getContentPane().add(iconBar1, "North");
        mainP.setLayout(new BorderLayout());
        mainP.setBorder(new BevelBorder(1));
        parFamilleJR.setText("par famille");
        buttonGroup1.add(parFamilleJR);
        parFamilleJR.setHorizontalAlignment(4);
        parFamilleJR.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                parFamilleJRActionPerformed(evt);
            }
        });
        parCommercialJR.setText("par commercial");
        buttonGroup1.add(parCommercialJR);
        parCommercialJR.setHorizontalAlignment(4);
        parCommercialJR.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                parCommercialJRActionPerformed(evt);
            }
        });
        parJR.setSelected(true);
        parJR.setText("par");
        buttonGroup1.add(parJR);
        parJR.setHorizontalAlignment(4);
        parJR.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                parJRActionPerformed(evt);
            }
        });
        selectJCB.setModel(new DefaultComboBoxModel(new String[]{
                    "CODE CLIENT", "RAISON SOCIALE", "CIVILITE", "VILLE", "CODE POSTAL"
                }));
        requeteF.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                requeteFActionPerformed(evt);
            }
        });
        validerB.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/me/images/search18x18.png")));
        validerB.setBorderPainted(false);
        validerB.setFocusPainted(false);
        validerB.setContentAreaFilled(false);
        validerB.setToolTipText("Lancer la recherche");
        validerB.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                validerBActionPerformed(evt);
            }
        });
        selectionP.add(jPanel1);
        mainP.add(selectionP, "North");
        dataP.setLayout(new BorderLayout());
        dataP.add(defiler, "Center");
        voletBas.setLayout(new GridLayout(1, 3));
        jPanel1.setLayout(flowLayout4);
        infoLeftL.setHorizontalAlignment(0);
        voletBas.add(infoLeftL);
        infoCenterL.setHorizontalAlignment(0);
        voletBas.add(infoCenterL);
        infoRightL.setHorizontalAlignment(0);
        voletBas.add(infoRightL);
        dataP.add(voletBas, "South");
        mainP.add(dataP, "Center");
        getContentPane().add(mainP, "Center");
        optionsM.setMnemonic('O');
        optionsM.setText("Options");
        newMI.setAccelerator(KeyStroke.getKeyStroke(78, 2));
        newMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/new.png")));
        newMI.setText("Nouveau");
        newMI.setEnabled(false);
        optionsM.add(newMI);
        openMI.setAccelerator(KeyStroke.getKeyStroke(79, 2));
        openMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/open.png")));
        openMI.setText("Ouvrir");
        openMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                openMIActionPerformed(evt);
            }
        });
        optionsM.add(openMI);
        saveMI.setAccelerator(KeyStroke.getKeyStroke(83, 2));
        saveMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/save.png")));
        saveMI.setText("Enregistrer");
        saveMI.setEnabled(false);
        optionsM.add(saveMI);
        modifyMI.setAccelerator(KeyStroke.getKeyStroke(77, 2));
        modifyMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/modify.png")));
        modifyMI.setText("Modifier");
        modifyMI.setEnabled(false);
        optionsM.add(modifyMI);
        removeMI.setAccelerator(KeyStroke.getKeyStroke(88, 2));
        removeMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/delete.png")));
        removeMI.setText("Supprimer");
        removeMI.setEnabled(false);
        optionsM.add(removeMI);
        optionsM.add(jSeparator1);
        printMI.setAccelerator(KeyStroke.getKeyStroke(80, 2));
        printMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/printer.png")));
        printMI.setText("Imprimer");
        printMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                printMIActionPerformed(evt);
            }
        });
        optionsM.add(printMI);
        helpMI.setAccelerator(KeyStroke.getKeyStroke(65, 2));
        helpMI.setIcon(new ImageIcon(getClass().getResource("/org/jpgolay/gui/iconBar/images/help.png")));
        helpMI.setText("Aide");
        helpMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                helpMIActionPerformed(evt);
            }
        });
        optionsM.add(helpMI);
        jMenuBar1.add(optionsM);
        setJMenuBar(jMenuBar1);
        jPanel1.setPreferredSize(new Dimension(920, 28));
        flowLayout4.setHgap(2);
        flowLayout4.setVgap(2);
        famillesJCB.setPreferredSize(new Dimension(150, 24));
        commerciauxJCB.setPreferredSize(new Dimension(150, 24));
        selectJCB.setPreferredSize(new Dimension(150, 24));
        requeteF.setPreferredSize(new Dimension(150, 24));
        validerB.setPreferredSize(new Dimension(24, 24));
        jPanel1.add(parFamilleJR, null);
        jPanel1.add(famillesJCB, null);
        jPanel1.add(parCommercialJR, null);
        jPanel1.add(commerciauxJCB, null);
        jPanel1.add(parJR, null);
        jPanel1.add(selectJCB, null);
        jPanel1.add(requeteF, null);
        jPanel1.add(validerB, null);
        pack();
    }

    private void parFamilleJRActionPerformed(ActionEvent evt) {
        parFamilles();
    }

    private void parJRActionPerformed(ActionEvent evt) {
        par();
    }

    private void parCommercialJRActionPerformed(ActionEvent evt) {
        parCommercial();
    }

    private void requeteFActionPerformed(ActionEvent evt) {
        valider();
    }

    private void validerBActionPerformed(ActionEvent evt) {
        valider();
    }

    private void openMIActionPerformed(ActionEvent evt) {
        ouvrir();
    }

    private void printMIActionPerformed(ActionEvent evt) {
        PrinterJob pj = PrinterJob.getPrinterJob();
        if (pj.printDialog()) {
            imprimer();
        }
    }

    private void helpMIActionPerformed(ActionEvent evt) {
        aide();
    }

    private void fillComboBox() {
        commerciauxJCB.setModel(new DefaultComboBoxModel(getSalesPersonList()));
        commerciauxJCB.setEnabled(false);
        FamilyUtility famillesClient = new FamilyUtility();
        famillesJCB.setModel(new DefaultComboBoxModel(famillesClient.getCustomerFamilyIdList()));
        famillesJCB.setEnabled(false);
    }

    private String[] getSalesPersonList() {
        if (crud == null) {
            crud = new ObjectCRUD();
        }
        java.util.Collection c = crud.readAll(null, 15);
        if (c != null) {
            SalesPerson salesPerson = null;
            ArrayList salesPersonList = new ArrayList(c);
            Iterator it = salesPersonList.iterator();
            String list[] = new String[salesPersonList.size()];
            commerciauxId = new int[salesPersonList.size()];
            for (int i = 0; it.hasNext(); i++) {
                salesPerson = (SalesPerson) it.next();
                commerciauxId[i] = salesPerson.getId().intValue();
                list[i] = salesPerson.getPrenom() + " " + salesPerson.getNom();
            }

            return list;
        } else {
            commerciauxId = null;
            return (new String[]{
                        "aucune"
                    });
        }
    }

    private void par() {
        commerciauxJCB.setEnabled(false);
        famillesJCB.setEnabled(false);
        selectJCB.setEnabled(true);
        requeteF.setEditable(true);
    }

    private void parCommercial() {
        commerciauxJCB.setEnabled(true);
        famillesJCB.setEnabled(false);
        selectJCB.setEnabled(false);
        requeteF.setEditable(false);
    }

    private void parFamilles() {
        famillesJCB.setEnabled(true);
        commerciauxJCB.setEnabled(false);
        selectJCB.setEnabled(false);
        requeteF.setEditable(false);
    }

    private void valider() {
        selectRequete();
    }

    private void ouvrir() {
    }

    private void imprimer() {
        print();
    }

    private void aide() {
        BrowserControl.displayURL("www.media-4-u.net");
    }

    private void getClientsByCode() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(1)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CODE CLIENT ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByCodeLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(8, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CODE CLIENT ]");
        } else {
            JOptionPane.showMessageDialog(this, "Le Code Client : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByRaisonSociale() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(2)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR RAISON SOCIALE ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByRaisonSocialeLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(9, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR RAISON SOCIALE ]");
        } else {
            JOptionPane.showMessageDialog(this, "La Raison Sociale : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByVille() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(3)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR VILLE ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByVilleLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(10, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR VILLE ]");
        } else {
            JOptionPane.showMessageDialog(this, "La Ville : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByCodePostaux() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(4)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CODES POSTAUX ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByCodePostauxLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(11, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CODES POSTAUX ]");
        } else {
            JOptionPane.showMessageDialog(this, "Le Code Postale : " + requeteF.getText() + "\nN'existe pas dans la liste des Clients !");
        }
    }

    private void getClientsByCivilite() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(7)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CIVILITE ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByCiviliteLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(12, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR CIVILITE ]");
        } else {
            JOptionPane.showMessageDialog(this, "La Civilite : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByPays() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(15)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR PAYS ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByPaysLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(13, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR PAYS ]");
        } else {
            JOptionPane.showMessageDialog(this, "Le Pays : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByTotalEncaisser() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(17)) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR TOTAL ENCAISSER ]");
        } else {
            JOptionPane.showMessageDialog(this, "Connexion \340 la Liste des des Clients Refus\351e.");
        }
    }

    private void getClientsByTotalEncaisserLike() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchBy(14, requeteF.getText())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR TOTAL ENCAISSER ]");
        } else {
            JOptionPane.showMessageDialog(this, "Le Total Encaisser : " + requeteF.getText() + "\nN'existe pas !");
        }
    }

    private void getClientsByFamilleId() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchById(5, (String) famillesJCB.getSelectedItem())) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ PAR FAMILLE " + (String) famillesJCB.getSelectedItem() + " ]");
        } else {
            JOptionPane.showMessageDialog(this, "Aucun Client n'est rattach\351 a la Famille : " + (String) famillesJCB.getSelectedItem());
        }
    }

    private void getClientsByCommerciauxId() {
        OLD_CustomerList listeClients = new OLD_CustomerList();
        if (listeClients.searchById(6, Integer.toString(commerciauxId[commerciauxJCB.getSelectedIndex()]))) {
            rangees = listeClients.getRangees();
            colonnes = listeClients.getColonnes();
            afficherListe();
            setTitle("LISTE CLIENTS     [ DU COMMERCIAL " + commerciauxJCB.getSelectedItem() + " ]");
        } else {
            JOptionPane.showMessageDialog(this, "Aucun Client n'est rattach\351 au Commercial : " + commerciauxJCB.getSelectedItem());
        }
    }

    private void afficherListe() {
        TableModel myModel = new TableModel();
        table = new JTable(myModel);
        tableModele();
        defiler.setViewportView(table);
        voletBas();
    }

    private void tableModele() {
        TableColumn column = new TableColumn();
        for (int i = 0; i < 9; i++) {
            column = table.getColumnModel().getColumn(i);
            if (i == 0) {
                column.setPreferredWidth(80);
            } else if (i == 1) {
                column.setPreferredWidth(160);
            } else if (i == 2) {
                column.setPreferredWidth(50);
            } else if (i == 3) {
                column.setPreferredWidth(20);
            } else if (i == 4) {
                column.setPreferredWidth(80);
            } else if (i == 5) {
                column.setPreferredWidth(60);
            } else if (i == 6) {
                column.setPreferredWidth(60);
            } else if (i == 7) {
                column.setPreferredWidth(30);
            } else {
                column.setPreferredWidth(50);
            }
        }

    }

    private void print() {
        String columnName[] = {
            "col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8", "col9"
        };
        Object data[][] = new Object[rangees.size() / colonnes.size()][9];
        int j = 0;
        for (int i = 0; i < data.length; i++) {
            data[i][0] = (String) rangees.get(j++);
            data[i][1] = (String) rangees.get(j++);
            data[i][2] = (String) rangees.get(j++);
            data[i][3] = (String) rangees.get(j++);
            data[i][4] = (String) rangees.get(j++);
            data[i][5] = (String) rangees.get(j++);
            data[i][6] = (String) rangees.get(j++);
            data[i][7] = (String) rangees.get(j++);
            data[i][8] = (String) rangees.get(j++);
        }

        ListPrint listPrint = new ListPrint(data, columnName, "customerList", true, param);
    }

    private void selectRequete() {
        if (parJR.isSelected()) {
            switch (selectJCB.getSelectedIndex()) {
                default:
                    break;

                case 0: // '\0'
                    if (requeteF.getText().equals("")) {
                        getClientsByCode();
                    } else {
                        getClientsByCodeLike();
                    }
                    break;

                case 1: // '\001'
                    if (requeteF.getText().equals("")) {
                        getClientsByRaisonSociale();
                    } else {
                        getClientsByRaisonSocialeLike();
                    }
                    break;

                case 2: // '\002'
                    if (requeteF.getText().equals("")) {
                        getClientsByCivilite();
                    } else {
                        getClientsByCiviliteLike();
                    }
                    break;

                case 3: // '\003'
                    if (requeteF.getText().equals("")) {
                        getClientsByVille();
                    } else {
                        getClientsByVilleLike();
                    }
                    break;

                case 4: // '\004'
                    if (requeteF.getText().equals("")) {
                        getClientsByCodePostaux();
                    } else {
                        getClientsByCodePostauxLike();
                    }
                    break;

                case 5: // '\005'
                    if (requeteF.getText().equals("")) {
                        getClientsByPays();
                    } else {
                        getClientsByPaysLike();
                    }
                    break;

                case 6: // '\006'
                    if (requeteF.getText().equals("")) {
                        getClientsByTotalEncaisser();
                    } else {
                        getClientsByTotalEncaisserLike();
                    }
                    break;
            }
            requeteF.setText("");
        } else if (parFamilleJR.isSelected()) {
            getClientsByFamilleId();
        } else if (parCommercialJR.isSelected()) {
            getClientsByCommerciauxId();
        }
    }

    private void voletBas() {
        infoLeftL.setText(table.getRowCount() + " ligne(s)");
    }

    public void setParameter(Parameter param) {
        this.param = param;
    }
    private ButtonGroup buttonGroup1;
    private JComboBox commerciauxJCB;
    private JPanel dataP;
    private JScrollPane defiler;
    private JComboBox famillesJCB;
    private JMenuItem helpMI;
    private IconBar iconBar1;
    private JLabel infoCenterL;
    private JLabel infoLeftL;
    private JLabel infoRightL;
    private JMenuBar jMenuBar1;
    private JPanel jPanel1;
    private JSeparator jSeparator1;
    private JPanel mainP;
    private JMenuItem modifyMI;
    private JMenuItem newMI;
    private JMenuItem openMI;
    private JMenu optionsM;
    private JRadioButton parCommercialJR;
    private JRadioButton parFamilleJR;
    private JRadioButton parJR;
    private JMenuItem printMI;
    private JMenuItem removeMI;
    private JTextField requeteF;
    private JMenuItem saveMI;
    private JComboBox selectJCB;
    private JPanel selectionP;
    private JButton validerB;
    private JPanel voletBas;
    private Vector rangees;
    private Vector colonnes;
    private JTable table;
    private Dimension screen;
    private int commerciauxId[];
    private final int CODE_CLIENT = 0;
    private final int RAISON_SOCIALE = 1;
    private final int CIVILITE = 2;
    private final int VILLE = 3;
    private final int CODE_POSTAL = 4;
    private final int PAYS = 5;
    private final int TOTAL_ENCAISSER = 6;
    private Parameter param;
    private ObjectCRUD crud;
}
